<?php
/**
 * Demonstrate use of the apache configuration file reader class.
 * 
 * @package AP5L
 * @subpackage Apache
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPLv3
 * @copyright 2007, Alan Langford
 * @version $Id: ApacheConfigDemo.php 91 2009-08-21 02:45:29Z alan.langford@abivia.com $
 * @author Alan Langford <alan.langford@abivia.com>
 * @todo Update from PHP4
 */

echo 'Apache Config Demo<br/>';

require_once('apache/ApacheConfig.php');

$simpleDumps = false;

$ac = new ApacheConfig();
//$ac -> verbose = true;
$ac -> readOpts('/etc/conf.d/apache2');
$ac -> read('/etc/apache2/httpd.conf');

if ($ac -> errMsg) {
    echo $ac -> errMsg . '<br/>';
} else {
    $out = new ApacheConfigWriter();
    $out -> options['showcomments'] = false;
    $out -> options['return'] = false;
    if ($simpledumps) {
        echo '<h1>Full Config</h1>';
        $out -> simpleDump($ac);
        echo '<h1>Active Config</h1>';
        $ac -> evaluate();
        $out -> simpleDump($ac);
    }
    $out -> report($ac);
}

?>